<!--
 * @Author: lp
 * @Date: 2022-03-12 14:03:17
 * @LastEditTime: 2022-03-16 20:12:01
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: //nien-vue3-admin//src//views//system//config//index.vue
-->
<template>
  <customContainer :config="config" />
</template>
<script lang="ts" setup>
import { reactive, markRaw } from 'vue'
import { ElButton } from 'element-plus'
import { getlistOrder } from '@/api/expressManager/orderList'
import { DictDirection } from '@/store/modules/dicts'

const config = reactive({
  query: {
    fields: [
      {
        type: 'selectV2',
        label: '客户',
        prop: 'customerCode',
        option: {
          dictInfo: {
            dict: DictDirection.客户,
          },
        },
      },
    ],
    queryParams: {
      pageSize: 10,
      pageNum: 1,
      customerCode: undefined,
      transportType: 1,
      isFasteners: 1,
      deptId: 257,
      userId: 3,
    },
    formOption: {},
  },
  table: {
    columns: [
      { type: 'selection', width: '55' },
      { label: '客户', prop: 'customerName' },
      {
        label: '销售产品',
        prop: 'marketProducts',
        autoFormatter: {
          dict: DictDirection.产品,
          rowKey: 'marketProducts',
        },
      },
      {
        label: '操作',
        render(h, params) {
          return h(
            ElButton,
            {
              text: true,
              type: 'primary',
              onClick: () => {
                console.log(params)
              },
            },
            {
              default: () => '操作',
            },
          )
        },
      },
    ],
    event: {
      onRowClick(e) {
        console.log(e)
      },
    },
  },
  api: getlistOrder,
  customKey: 'system-config',
})
</script>
